package com.kd.controller.jobSeeker;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.pagehelper.PageInfo;
import com.kd.bean.admin.Admin_msg;
import com.kd.bean.jobSeeker.Basic_information;
import com.kd.bean.jobSeeker.Report_recruitment_msg;
import com.kd.bean.jobSeeker.Report_recruitment_person;
import com.kd.service.jobSeeker.IReport_recruitment_personService;

/**
 * 查询举报人
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/report_recruitment_person")
public class Report_recruitment_personController {

	@Autowired
	private IReport_recruitment_personService personService;
	
	@RequestMapping("/queryAllByRrp_report_state")
	@ResponseBody
	public PageInfo<Report_recruitment_person> queryAllByRrp_report_state(Integer pageNum,Integer pageSize){
		PageInfo<Report_recruitment_person> info = null;
		try {
			info = personService.queryAllByRrp_report_state(pageNum, pageSize);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return info;
	}
	
	@RequestMapping("/updateRrp_report_state")
	@ResponseBody
	public Boolean updateRrp_report_state(Integer rrp_id,Integer rrp_report_state,HttpSession session){
		Boolean flag = false;
		try {
			Admin_msg adminMsg = (Admin_msg) session.getAttribute("adminMsg");
			//修改审核状态管理员操作
			flag = personService.updateRrp_report_state(rrp_id, rrp_report_state,adminMsg.getAdmin_id());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return flag;
	}
	@RequestMapping("/insertReport_recruitment_person")
	@ResponseBody
	public Boolean insertReport_recruitment_person(Report_recruitment_person report_recruitment_person,HttpSession session) {
		Basic_information  basicMessage = (Basic_information) session.getAttribute("basicMessage");
		Boolean flag = false;
		try {
			report_recruitment_person.setBasic_id(basicMessage.getBasic_id());
			flag = personService.insertReport_recruitment_person(report_recruitment_person);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return flag;
	}
}
